1
2 # coding: utf-
8
3
4 # In[
1]:
5
6
7 def age_program():
8     seconds_or_years = input(
'Give me seconds (s) or years (y) ')
9     
if seconds_or_years =='s':
10         #convert seconds to years
11         user_value = input(
"Enter the number of seconds you've lived for:" )
12         print(
"You've lived for {} years.".format(int(user_value)/60/60/24/365))
13     elif seconds_or_years ==
'y':
14         #convert years to seconds
15         user_value = input(
"Enter the number of years you've lived for: ")
16         print(
"You've lived for {} seconds.".format(int(user_value)*365*24*60*60))
17
18
19 # In[
2]:
20
21
22 age_program()
23
24
25 # In[
3]:
26
27
28 age_program()


Gõ tìm kiếm nhanh...